<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * 后台主页
 * @property Admin_mdl $admin
 */
class Main extends Admin_Controller {

	public function __construct() {
		parent::__construct ();
		$this->load->helper('url');
		$this->load->model('Admin_mdl','admin');
	}
	/**
	 * 输出框架
	 */
	public function index(){
		$this->load->view('admin/main/main');
	}
	/**
	 * 首页
	 */
	public function home(){
		$admin = $this->admin->getUser();
		$temp['admin'] = $admin;
		$this->load->view('admin/main/home',$temp);
	}

	public function top(){
		$admin = $this->admin->getUser();
		$temp['admin'] = $admin;
		$this->load->view('admin/main/top',$temp);
	}
	/**
	 * 左侧导航条
	 */
	public function left(){
		$this->load->model('Admin_mdl','admin');
		$this->load->helper('category');

		$admin = $this->admin->getUser();
		$category_list = $this->admin->getVisibleMenuList($admin['id']);
		$category_list = Category::unlimitedForLayer($category_list,'child',0,'parentID');
// 		pr($category_list);die;
		$temp['category_list']=$category_list;
		$this->load->view('admin/main/left',$temp);
	}
	public function footer(){
		$this->load->view('admin/main/footer');
	}
}
